

#include <hash.h>
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv){

  hash_t *tbl = hash_new(8);

  hash_key *key1 = hash_new_key("11111834sd", 10);
  hash_print_key(key1);

  double data = 50.0;
  double other_data;
  hash_add(tbl, "50.0", 4, &data);
  hash_add(tbl, "another elem", 12, &data);
  hash_add(tbl, "second 50", 9, &data);
  hash_add(tbl, "third 50", 8, &data);
  hash_add(tbl, "blah blah", 9, &data);
  hash_add(tbl, "ksudghfsl", 9, &data);
  hash_add(tbl, "sdldffsjd", 9, &other_data);

  //hash_print(tbl);

  hash_elem *get1 = hash_remove(tbl, "second 50", 9);
  if (get1) hash_print_elem(get1);
  else printf("NULL\n");
  
  get1 = hash_remove(tbl, "another elem", 12);
  if (get1) hash_print_elem(get1);
  else printf("NULL\n");

  get1 = hash_remove(tbl, "blah blah", 9);
  if (get1) hash_print_elem(get1);
  else printf("NULL\n");
  
  get1 = hash_remove(tbl, "sdldffsjd", 9);
  if (get1) hash_print_elem(get1);
  else printf("NULL\n");

  get1 = hash_remove(tbl, "pah pah p", 9);
  if (get1) hash_print_elem(get1);
  else printf("NULL\n");

  hash_print(tbl);

  return 0;
  
}
